<template>
  <div id="app">
    <el-row class="container" style="height: 100%">
      <v-header></v-header>
        <el-col :span="24" class="main"> 
          <el-row>
            <el-menu :default-active="$route.path" class="mar-l el-menu-vertical-demo el-col el-col-3 leftNav" light router> 
              <div class="userBox">
                <img src="" alt="">
                <div class="userName">你好！乐推nice</div>
              </div>
                <el-menu-item :index="item.path"  v-for="(item,index) in navList" :key="item.path" >
                  <i class="el-icon-setting" :index="index"></i>
                  <span slot="title" class="txt">{{item.alias}}</span>
                </el-menu-item>
                <div class="leftFooter">
                  <!-- <p>客服QQ：951697173</p>
                  <p>联系我们：18021376072</p> -->
                </div>
            </el-menu>
            <section class="contenCon">
            <el-col :span="21" :offset="3" class="content-wrapper">
              <transition name="fade">
                <router-view></router-view>
              </transition>
            </el-col>
            </section>
          </el-row>
        </el-col>
    </el-row>
  </div>
</template>

<script>
import header from "./components/header";
import leftNav from "./components/leftNav";
export default {
  name: "App",
  data() {
    return {
      navList: []
    };
  },
  mounted() {
    this.getNavList();
  },
  methods: {
    getNavList() {
      let arr = this.$router.options.routes;
      this.navList = arr.slice(0, arr.length - 1);
    }
  },
  components: {
    "v-header": header,
    leftNav
  }
};
</script>
<style lang="stylus" scoped>
@import '~styles/varibles.styl';

.main {
  margin-top: 70px;
  z-index: 98;

  .menu, .el-menu {
    height: 100%;
    background-color: #262c38;
    position: fixed;
    float: left;
    color: $darkTextColor9;
    z-index: 99;
    min-width: 150px;

    .el-menu-item {
      color: $darkTextColor9;
    }

    .el-menu-item.is-active {
      color: $bgColor;
    }

    .el-menu-item:focus, .el-menu-item:hover {
      outline: 0;
      background-color: #1a1f2a;
    }

    .el-menu-item, .el-submenu__title {
      height: 45px;
      line-height: 45px;
    }

    .userBox {
      width: 114px;
      height: 114px;
      background: #f3f4f9;
      margin: 40px auto 70px auto;
      border-radius: 50%;
      position: relative;
      border: 6px solid #1a1f2a;

      img {
        width: 100%;
        height: 100%;
      }

      .userName {
        position: absolute;
        top: 140px;
        width: 100%;
        text-align: center;
        color: #fff;
        font-size: 16px;
      }
    }

    .leftFooter {
      position: absolute;
      left: 0;
      bottom: 70px;
      width: 100%;
      height: 60px;
      text-align: center;
      color: #656566;
      font-size: 12px;

      p {
        line-height: 25px;
      }
    }
  }

  .contenCon {
    margin: 0px 0px 0 0px;
  }
}
</style>

